Skip to content

Conversation

billyvg
Copy link
Member

@billyvg billyvg commented Jan 13, 2025

  • Merged upstream PRs to change build system to [mostly] use vite.

Ref getsentry/rrweb#234

Copy link
Contributor

github-actions bot commented Jan 13, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.99 KB - -
@sentry/browser - with treeshaking flags 22.88 KB - -
@sentry/browser (incl. Tracing) 35.71 KB - -
@sentry/browser (incl. Tracing, Replay) 72.66 KB +0.2% +148 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 66.18 KB +0.2% +129 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 77.26 KB +0.64% +502 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 89.38 KB +0.16% +143 B 🔺
@sentry/browser (incl. Feedback) 39.68 KB - -
@sentry/browser (incl. sendFeedback) 27.63 KB - -
@sentry/browser (incl. FeedbackAsync) 32.4 KB - -
@sentry/react 25.66 KB - -
@sentry/react (incl. Tracing) 38.49 KB - -
@sentry/vue 27.06 KB - -
@sentry/vue (incl. Tracing) 37.45 KB - -
@sentry/svelte 23.11 KB - -
CDN Bundle 24.38 KB - -
CDN Bundle (incl. Tracing) 36.02 KB - -
CDN Bundle (incl. Tracing, Replay) 70.78 KB +0.17% +118 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 75.95 KB +0.18% +136 B 🔺
CDN Bundle - uncompressed 71.2 KB - -
CDN Bundle (incl. Tracing) - uncompressed 106.89 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 217.61 KB -0.06% -130 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 230.18 KB -0.06% -130 B 🔽
@sentry/nextjs (client) 38.6 KB - -
@sentry/sveltekit (client) 36.23 KB - -
@sentry/node 156.24 KB - -
@sentry/node - without tracing 97.38 KB - -
@sentry/aws-serverless 106.8 KB -0.01% -1 B 🔽

View base workflow run

@billyvg
Copy link
Member Author

billyvg commented Jan 13, 2025

Suspicious?
image

edit I ran yarn size-limit --save-bundle (note it only works with a single entry in .size-limit.js) and diff'ed the two bundles. There was no different in the diff so not sure what happened

Copy link

codecov bot commented Jan 15, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
695 1 694 299
View the top 1 failed tests by shortest run time
tracing/request/fetch/test.ts should create spans for fetch requests
Stack Traces | 10.1s run time
test.ts:7:11 should create spans for fetch requests

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@billyvg billyvg force-pushed the ref-replay-bump-rrweb-2.32.0-vite-change branch from c288baf to ab4ee38 Compare January 15, 2025 18:39
@billyvg
Copy link
Member Author

billyvg commented Jan 15, 2025

  • Had to tweak output of rrweb bundles to be es2020
  • There's a mysterious enum thats getting pulled in, that I can't seem to find the source of:
  var dc, pc;
  (lc.mirror = uc),
    (lc.takeFullSnapshot = function (t) {
      if (!cc) throw new Error('please take full snapshot after start recording');
      cc(t);
    }),
    ((pc = dc || (dc = {}))[(pc.NotStarted = 0)] = 'NotStarted'),
    (pc[(pc.Running = 1)] = 'Running'),
    (pc[(pc.Stopped = 2)] = 'Stopped');
  const hc = 3;
  function mc(t) {
    return t > 9999999999 ? t : 1e3 * t;
  }
  function fc(t) {
    return t > 9999999999 ? t / 1e3 : t;
  }
  function gc(t, e) {
    'sentry.transaction' !== e.category &&

It seems to correspond with this block of imports

  try {
    if (2 !== Array.from([1], t => 2 * t)[0]) {
      const t = document.createElement('iframe');
      document.body.appendChild(t),
        (Array.from = t.contentWindow?.Array.from || Array.from),
        document.body.removeChild(t);
    }
  } catch (t) {
    console.debug('Unable to override Array.from', t);
  }
  var vl;
  new (class {
    constructor() {
      Gu(this, 'idNodeMap', new Map()), Gu(this, 'nodeMetaMap', new WeakMap());
    }
    getId(t) {
      if (!t) return -1;
      const e = this.getMeta(t)?.id;
      return e ?? -1;
    }
    getNode(t) {
      return this.idNodeMap.get(t) || null;
    }
    getIds() {
      return Array.from(this.idNodeMap.keys());
    }
    getMeta(t) {
      return this.nodeMetaMap.get(t) || null;
    }
    removeNodeFromMap(t) {
      const e = this.getId(t);
      this.idNodeMap.delete(e), t.childNodes && t.childNodes.forEach(t => this.removeNodeFromMap(t));
    }
    has(t) {
      return this.idNodeMap.has(t);
    }
    hasNode(t) {
      return this.nodeMetaMap.has(t);
    }
    add(t, e) {
      const n = e.id;
      this.idNodeMap.set(n, t), this.nodeMetaMap.set(t, e);
    }
    replace(t, e) {
      const n = this.getNode(t);
      if (n) {
        const t = this.nodeMetaMap.get(n);
        t && this.nodeMetaMap.set(e, t);
      }
      this.idNodeMap.set(t, e);
    }
    reset() {
      (this.idNodeMap = new Map()), (this.nodeMetaMap = new WeakMap());
    }
  })(),
    (function (t) {
      (t[(t.NotStarted = 0)] = 'NotStarted'), (t[(t.Running = 1)] = 'Running'), (t[(t.Stopped = 2)] = 'Stopped');
    })(vl || (vl = {}));

@billyvg
Copy link
Member Author

billyvg commented Jan 15, 2025

  • the enum comes from xstate
  • The mirror + Array.from polyfill are side-effects inside of record/index.ts -- in replayCanvas, when we import CanvasManager, we also pull in these side-effects. Previously, our rrweb bundle preserved modules (esm), and we were able to import only CanvasManager. Now our esm build outputs to a single file (default to vite).

@billyvg
Copy link
Member Author

billyvg commented Jan 16, 2025

Tried to have a separate CanvasManager entrypoint, but this breaks the tests due to the umd bundle require() the canvas manager module.

* Merged upstream PRs to change build system to [mostly] use vite.
@billyvg billyvg force-pushed the ref-replay-bump-rrweb-2.32.0-vite-change branch from 4d1efba to db5d2ff Compare January 21, 2025 22:19
@billyvg billyvg marked this pull request as ready for review January 21, 2025 22:49
@billyvg billyvg requested a review from a team as a code owner January 21, 2025 22:49
@billyvg billyvg closed this Feb 28, 2025
@billyvg billyvg deleted the ref-replay-bump-rrweb-2.32.0-vite-change branch February 28, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants